package bold.module.thrift.server;

import bold.module.thrift.genapi.UserI;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.server.TThreadedSelectorServer;
import org.apache.thrift.transport.TNonblockingServerSocket;
import org.apache.thrift.transport.TTransportException;

public class Server3 {
    public static void main(String[] args) throws TTransportException {
        TThreadedSelectorServer.Args serverParams =
                new TThreadedSelectorServer.Args(new TNonblockingServerSocket(8888))
                        .protocolFactory(new TBinaryProtocol.Factory())
                        .processor(new UserI.Processor<>(new UserService()));

        new TThreadedSelectorServer(serverParams).serve();
    }
}
